package com.micro.trace.log.handler;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import static com.micro.trace.log.cants.Constant.KEY_MAPPER_HANDLER;

public class PerceptionHandlerInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        request.setAttribute(KEY_MAPPER_HANDLER, handler);
        return HandlerInterceptor.super.preHandle(request, response, handler);
    }

}
